package edu.cast.teseg.algoritmos.voraz;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author edgarin
 */
public class ExtraerMin {

    public ExtraerMin() { }   
    
    //*** metodo que retorna un minimo vertice visitado ***//
    public static int  getExtraerMin(int [] distancia, boolean [] marca) {
        
        int minimo = 999;
        int vertice = 0;
         
        for (int i = 1; i < distancia.length; i++) {
            if (minimo > distancia[i] && !marca[i]) {                
                minimo=distancia[i];
                vertice =i;
            }            
        }
        return vertice;         
    }    
    
}
